package com.dianping.cat.alarm.policy.entity;

import com.dianping.cat.alarm.policy.BaseEntity;
import com.dianping.cat.alarm.policy.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;




public class Type
  extends BaseEntity<Type>
{
  private String m_id;
/* 15 */   private Map<String, Group> m_groups = new LinkedHashMap();





/* 21 */   public Type(String id) { this.m_id = id; }




/* 26 */   public void accept(IVisitor visitor) { visitor.visitType(this); }


  public Type addGroup(Group group) {
/* 30 */     this.m_groups.put(group.getId(), group);
/* 31 */     return this;
  }


  public boolean equals(Object obj) {
/* 36 */     if (obj instanceof Type) {
/* 37 */       Type _o = (Type)obj;

/* 39 */       if (!equals(getId(), _o.getId())) {
/* 40 */         return false;
      }

/* 43 */       return true;
    }

/* 46 */     return false;
  }


/* 50 */   public Group findGroup(String id) { return (Group)this.m_groups.get(id); }


  public Group findOrCreateGroup(String id) {
/* 54 */     Group group = (Group)this.m_groups.get(id);

/* 56 */     if (group == null) {
/* 57 */       synchronized (this.m_groups) {
/* 58 */         group = (Group)this.m_groups.get(id);

/* 60 */         if (group == null) {
/* 61 */           group = new Group(id);
/* 62 */           this.m_groups.put(id, group);
        }
      }
    }

/* 67 */     return group;
  }


/* 71 */   public Map<String, Group> getGroups() { return this.m_groups; }



/* 75 */   public String getId() { return this.m_id; }







/* 89 */   public void mergeAttributes(Type other) { assertAttributeEquals(other, "type", "id", this.m_id, other.getId()); }




/* 94 */   public Group removeGroup(String id) { return (Group)this.m_groups.remove(id); }


  public Type setId(String id) {
/* 98 */     this.m_id = id;
/* 99 */     return this;
  }

  public Type() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-alarm-3.0.0.jar!/com/dianping/cat/alarm/policy/entity/Type.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */